package com.yan.crowd.api;

import com.yan.crowd.entity.po.MemberPO;
import com.yan.crowd.entity.vo.*;
import com.yan.crowd.util.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("crowd-mysql")
public interface MysqlRemoteService {

    @RequestMapping("/get/memberpo/by/login/acct/remote")
    ResultEntity<MemberPO> getMemberPOByLoginAcctRemote(@RequestParam("loginacct") String loginacct);

    @RequestMapping("/save/member/remote")
    public ResultEntity<MemberPO> saveMember(@RequestBody MemberPO memberPO);

    @RequestMapping("/save/project/vo/remote")
    ResultEntity<String> saveProjectVORemote(@RequestBody ProjectVo projectVo,@RequestParam("memberId") Integer memberId);

    @RequestMapping("/get/portal/type/project/data/remote")
    public ResultEntity<List<PortalTypeVO>> getPortalTypeVO();

    @RequestMapping("/get/project/detail/remote/{id}")
    public ResultEntity<DetailProjectVO> getDetailProjectVORemote(@PathVariable("id")Integer id);

    @RequestMapping("/get/order/project/vo/remote")
    ResultEntity<OrderProjectVO> getOrderProjectVO(@RequestParam("returnId") Integer returnId);

    @RequestMapping("/get/address/vo/remote")
    ResultEntity<List<AddressVO>> getAddressListByMemberIdRemote(Integer id);

    @RequestMapping("/save/address/vo/remote")
    ResultEntity<String> saveAddress(@RequestBody AddressVO addressVO);

    @RequestMapping("/save/order/vo/remote")
    ResultEntity<String> saveOrderRemote(@RequestBody OrderVO orderVO);
}
